<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%response.setHeader("cache-control","public"); %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<!-- 创建考试第一步 -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>考务管理</title>
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/css/font/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/css/examMng/core.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/css/examMng/exam-org-deta.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/css/examMng/exam-org.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/css/examMng/jquery-ui-1.8.17.custom.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/css/examMng/jquery-ui-timepicker-addon.css"/>
	<!--bootstrap基础引用 start-->
    <script type="text/javascript" src="<%=path%>/static/jstreeview/bootstrap/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="<%=path%>/static/jstreeview/bootstrap/bootstrap.min.js"></script>
    <!--bootstrap基础引用 end-->
    <!--bootstrap-dialog start-->
    <link rel="stylesheet" type="text/css" href="<%=path%>/static/jstreeview/plugins/bootstrap-dialog/bootstrap-dialog.min.css">
    <script type="text/javascript" src="<%=path%>/static/jstreeview/plugins/bootstrap-dialog/bootstrap-dialog.min.js"></script>
    <!--bootstrap-dialog end-->
    <script src="<%=path%>/static/js/respond.js"></script>
    <!--[if !IE]> -->
    <script type="text/javascript">
        window.jQuery || document.write("<script src='<%=path%>/static/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
    </script>
    <!-- <![endif]-->
    <script type="text/javascript">
        window.jQuery || document.write("<script src='<%=path%>/static/js/jquery-1.9.1.min.js'>" + "<" + "/script>");
    </script>
</head>

<body>

<jsp:include page="../head.jsp" flush="true"/>
<div class="main-container albox-pad-top padingtop0">
    <div class="panel container body-box">
        <div class="panel-heading col-lg-12 col-md-12  top-brgclr" style="height: 70px;">
            <p class=" col-lg-10 col-md-10 col-sm-10 color-fff">修改个人信息</p>
            <a class="color-fff floatrit aahover fontweight400" href="<%=path%>/static/sys/index"><span
                    class="glyphicon glyphicon-arrow-left "></span> 返回</a>
        </div>
        <div class="panel-body minheight" style="min-height: 0px;">
            <div class=" borderbottom">
            </div>
            <!--
                作者：306794978@qq.com
                时间：2016-06-22
                描述：第一步开始
            -->
            <div id="stypediv" class=" form-box col-lg-12 col-md-12 col-sm-12 stype1displaynone2"
                 style="min-height: 260px;">
                <div class="form-group col-lg-12 col-md-12 col-sm-12 padding-0">
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">编号</div>
                            <input type="text" id="identifier" class="form-control" value="${user.identifier}" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">姓名</div>
                            <input type="text" class="form-control" value="${user.name }" id="username" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">单位</div>
                            <input type="text" class="form-control" value="${unit.name}" id="unit" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">角色</div>
                            <input type="text" class="form-control" value="${role.name }" id="role" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">账号</div>
                            <input type="text" class="form-control" maxlength="30" value="${user.account }"
                                   id="account" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">密码</div>
                            <input type="text" class="form-control" value="********" placeholder=""
                                   onBlur="textBlur(this)" onFocus="textFocus(this)" disabled/>
                        </div>
                    </div>

                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">士兵号</div>
                            <input type="text" class="form-control" value="${user.soldierId }" id="soldierId" maxlength="30" disabled/>
                        </div>
                    </div>

                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">身份证号</div>
                            <input type="text" class="form-control" value="${user.identityId }" id="identityId" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">文化程度</div>
                            <input type="text" class="form-control" value="${user.education }" id="education" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">性别</div>
                            <input type="text" class="form-control" value="${user.sex }" id="sex" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">先部别</div>
                            <input type="text" class="form-control" value="${user.position }" id="position" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">军衔</div>
                            <input type="text" class="form-control" value="${user.armyRank }" id="armyRank" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">从事专业</div>
                            <input type="text" class="form-control" value="${user.specialty }" id="specialty" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">申报专业</div>
                            <input type="text" class="form-control" value="${user.workCategory }" id="workCategory" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">申报等级</div>
                            <input type="text" class="form-control" value="${user.declarelevel }" id="declarelevel" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">工作年限</div>
                            <input type="text" class="form-control" value="${user.serviceYear }" id="serviceYear" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">出生年月</div>
                            <input type="text" class="form-control" value="${user.birthdate }" id="birthdate" maxlength="30" disabled/>
                        </div>
                    </div>
                    <div class="input-group-box col-lg-6 col-md-6 col-sm-6">
                        <div class="input-group col-lg-12 col-md-12 col-sm-12">
                            <div class="input-group-addon width150">入伍年月</div>
                            <input type="text" class="form-control" value="${user.addArmy }" id="addArmy" maxlength="30" disabled/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="stypebox">
        <div class=" form-submit floatleft">
            <div id="stypeback" class="btn btn-default margintopbom ">
                <span class="">修改密码</span>
            </div>
        </div>
        <div class="form-submit floatrit">
            <div id="validation" class="btn btn-info margintopbom">
                <span style="color: #FFFFFF">确定 </span>
            </div>
        </div>
    </div>
    <div class="modal" id="mymodal">
        <div class="modal-dialog" style="width:320px">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span></button>
                    <h4 class="modal-title">请输入原密码:</h4>
                </div>
                <div id="content" class="modal-body">

                    <span>原密码: </span>
                    <input id="yuanpass" type="text" class="form-control" value="" placeholder="请输入原始密码"/>
                    <span>新密码: </span>
                    <input id="newpass" type="text" class="form-control" value="" placeholder="请输入新密码"/>
                    <span>确认密码: </span>
                    <input id="confirmpass" type="text" class="form-control" value="" placeholder="请确认密码"/>

                    <div id="passcancel" class="btn btn-info margintopbom">
                        <span style="color: #FFFFFF">取消</span>
                        <span class="glyphicon glyphicon-cancel  lineheightx"></span>
                    </div>
                    <div id="passok" class="btn btn-info margintopbom">
                        <span style="color: #FFFFFF">提交</span>
                        <span class="glyphicon glyphicon-ok  lineheightx"
                              style="margin-left: 25px;color: #FFFFFF"></span>
                    </div>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <!--body end-->
    <script type="text/javascript" src="<%=path%>/static/js/jquery-ui.min.js"></script>
    <script type="text/javascript" src="<%=path%>/static/js/jquery.selectlist.js"></script>
    <script type="text/javascript" src="<%=path%>/static/js/global.js"></script>
    <script type="text/javascript" src="<%=path%>/static/js/tooltip.js"></script>
</div>
</body>
<script type="text/javascript">
    $(function () {

        // $('#topMain').children().eq(3).addClass('active'); // 追加样式;

        //人员管理
        if (${role eq 'master'}) {
            $('#topMain').children().eq(6).addClass('active'); // 追加样式;
            $('#topMain').children().eq(6).children().attr('href', '#');
        } else if (${role eq 'trainee'}) {
            $('#topMain').children().eq(0).addClass('active'); // 追加样式;
            $('#topMain').children().eq(0).children().attr('href', '#');
        } else {
            $('#topMain').children().eq(6).addClass('active'); // 追加样式;
            // $('#topMain').children().eq(0).children().attr('href', '#');
        }



    })
    $(document).ready(function () {
        $("#proDiv").css("display", "none");
        $("#rankDiv").css("display", "none");
    })
    var titleType = 0;
    //select下拉框模拟
    $("#passok").click(function () {
        var yuanpass = $("#yuanpass").val();
        var newpass = $("#newpass").val();
        var confirmpass = $("#confirmpass").val();
        $.ajax({
            url: '<%=basePath%>person/update',
            data: {
                yuanpass: yuanpass,
                newpass: newpass,
                confirmpass: confirmpass,
                flag: "password"
            },
            dataType: "json",
            success: function (data) {
            	BootstrapDialog.confirm({
    				title : '提示',
    				message : data.msg,
    				size : BootstrapDialog.SIZE_SMALL,
    				type : BootstrapDialog.TYPE_DEFAULT,
    				closable : true,
    				btnCancelLabel : '取消',
    				btnOKLabel : '确定'
    			});
            }
        });
    });

    $("#stypeback").click(function () {

        $("#mymodal").modal({backdrop: 'static', keyboard: false});


    })
    $("#validation").click(function () {

        var username = $("#username").val();
        var identifier = $("#identifier").val();
        var account = $("#account").val();
        $.ajax({
            url: '<%=basePath%>person/update',
            data: {
                identifier: identifier,
                name: username,
                account: account
            },
            dataType: "json",
            success: function (data) {
            	BootstrapDialog.confirm({
    				title : '提示',
    				message : data.msg,
    				size : BootstrapDialog.SIZE_SMALL,
    				type : BootstrapDialog.TYPE_DEFAULT,
    				closable : true,
    				btnCancelLabel : '取消',
    				btnOKLabel : '确定'
    			});
            }
        });
    })
</script>

</html>